<?php include('config.php') ?>
<?php
session_start();
$stud_ID=$_SESSION['user_ID'];
$sql = "SELECT survey.* FROM survey "
    . "WHERE survey.ID NOT IN (SELECT completed.survey_ID FROM completed WHERE completed.stud_ID=$stud_ID)";
 $data = mysql_query($sql) or die('Error completing query: ' . mysql_error());
 
 
 //print info to table
 Print "<table>"; 
 Print "<tr>"; 
 Print "<th>Course</th>"; 
 Print "<th>Survey</th>";
 
 while($info = mysql_fetch_array($data)) 
 { 
 Print "<tr>"; 
 Print "<td>".$info['course_name'] . "</td> "; 
 Print "<td><a href=\"take_survey.php?survey_ID=".$info['ID']."\">".$info['survey_name'] . "</a></td></tr>"; 
 } 
 Print "</table>"; 
 ?>